home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / tag_env / tagenv.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  4.9 KB  |  169 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   4335
  5.    ClientLeft      =   990
  6.    ClientTop       =   1620
  7.    ClientWidth     =   6765
  8.    Height          =   4740
  9.    Left            =   930
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4335
  13.    ScaleWidth      =   6765
  14.    Top             =   1275
  15.    Width           =   6885
  16.    Begin CommandButton ButtonExit 
  17.       Caption         =   "Exit"
  18.       Height          =   372
  19.       Left            =   2280
  20.       TabIndex        =   5
  21.       Top             =   3600
  22.       Width           =   1932
  23.    End
  24.    Begin CommandButton TaggedCtl 
  25.       Caption         =   "Show All Tags"
  26.       Height          =   372
  27.       Left            =   3360
  28.       TabIndex        =   6
  29.       Top             =   2880
  30.       Width           =   1932
  31.    End
  32.    Begin CommandButton ButtonSet 
  33.       Caption         =   "Set"
  34.       Height          =   372
  35.       Left            =   3480
  36.       TabIndex        =   9
  37.       Top             =   1920
  38.       Width           =   732
  39.    End
  40.    Begin CommandButton ButtonGet 
  41.       Caption         =   "Get"
  42.       Height          =   372
  43.       Left            =   2280
  44.       TabIndex        =   8
  45.       Top             =   1920
  46.       Width           =   852
  47.    End
  48.    Begin TextBox ValueIn 
  49.       Height          =   372
  50.       Left            =   3120
  51.       TabIndex        =   3
  52.       Top             =   1320
  53.       Width           =   3012
  54.    End
  55.    Begin TextBox KeyIn 
  56.       Height          =   372
  57.       Left            =   840
  58.       TabIndex        =   1
  59.       Top             =   1320
  60.       Width           =   1932
  61.    End
  62.    Begin Label Label2 
  63.       Caption         =   "Tagged Control"
  64.       Height          =   372
  65.       Left            =   1440
  66.       TabIndex        =   7
  67.       Top             =   2880
  68.       Width           =   1692
  69.    End
  70.    Begin Label Label3 
  71.       Caption         =   "Value"
  72.       Height          =   252
  73.       Left            =   3120
  74.       TabIndex        =   4
  75.       Top             =   960
  76.       Width           =   1812
  77.    End
  78.    Begin Label Label6 
  79.       Caption         =   "Enter key"
  80.       Height          =   252
  81.       Left            =   960
  82.       TabIndex        =   2
  83.       Top             =   960
  84.       Width           =   1812
  85.    End
  86.    Begin Label Label1 
  87.       Alignment       =   2  'Center
  88.       Caption         =   "Test Of Tag Environment Subsystem"
  89.       FontBold        =   -1  'True
  90.       FontItalic      =   0   'False
  91.       FontName        =   "MS Sans Serif"
  92.       FontSize        =   12
  93.       FontStrikethru  =   0   'False
  94.       FontUnderline   =   0   'False
  95.       Height          =   492
  96.       Left            =   960
  97.       TabIndex        =   0
  98.       Top             =   240
  99.       Width           =   5052
  100.    End
  101. Sub ButtonExit_Click ()
  102.     End
  103. End Sub
  104. Sub ButtonGet_Click ()
  105.     Dim theKey As String
  106.     Dim theValue As String
  107.     theKey = LTrim$(RTrim$(KeyIn.Text))
  108.     If theKey <> "" Then
  109.         ValueIn.Text = ""
  110.         GetCtlTagString TaggedCtl, theKey, theValue
  111.         ValueIn.Text = theValue
  112.     Else
  113.         Beep
  114.     End If
  115. End Sub
  116. Sub ButtonSet_Click ()
  117.     Dim theKey As String
  118.     Dim theValue As String
  119.     theKey = LTrim$(RTrim$(KeyIn.Text))
  120.     If theKey <> "" Then
  121.         theValue = LTrim$(RTrim$(ValueIn.Text))
  122.         SetCtlTagString TaggedCtl, theKey, theValue
  123.     Else
  124.         Beep
  125.     End If
  126. End Sub
  127. Sub Form_Load ()
  128.     Dim theKey As String
  129.     Dim theValue As String
  130.     SetFormTagString Form1, "FormName", "Form1"
  131.     SetFormTagString Form1, "MyName", "Tom Dacon"
  132.     SetFormTagString Form1, "My Full Name", "Thomas A. Dacon"
  133.     SetFormTagString Form1, "WithQuotes", """with enclosing quotes"""
  134.     Debug.Print Form1.Tag
  135.     theKey = "formname"
  136.     GoSub GetAndPrint
  137.     theKey = "myname"
  138.     GoSub GetAndPrint
  139.     theKey = "my full name"
  140.     GoSub GetAndPrint
  141.     theKey = "WITHQUOTES"
  142.     GoSub GetAndPrint
  143.     Exit Sub
  144. GetAndPrint:
  145.     GetFormTagString Form1, theKey, theValue
  146.     Debug.Print "["; theKey; "]"; "  ";
  147.     Debug.Print "["; theValue; "]"
  148.     Return
  149. End Sub
  150. Sub TaggedCtl_Click ()
  151.     Debug.Print TaggedCtl.Tag
  152. End Sub
  153. Sub ValueIn_KeyPress (KeyAscii As Integer)
  154. '   User entered something in the value field.
  155.     Dim theKey As String
  156.     Dim theValue As String
  157.     If KeyAscii = 13 Then   'Enter key
  158.         theKey = LTrim$(RTrim$(KeyIn.Text))
  159.         If theKey <> "" Then
  160.             theValue = LTrim$(RTrim$(ValueIn.Text))
  161.             SetCtlTagString TaggedCtl, theKey, theValue
  162.             GetCtlTagString TaggedCtl, theKey, theValue
  163.             ValueIn.Text = theValue
  164.         Else
  165.             Beep
  166.         End If
  167.     End If
  168. End Sub
  169.